home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume8 / help.jn < prev    next >
Encoding:
Text File  |  1989-08-19  |  59.7 KB  |  1,930 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v08i001: A HELP facility for Unix
  3. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  4. Reply-To: nelson@uncecs.edu (jim nelson)
  5.  
  6. Posting-number: Volume 8, Issue 1
  7. Submitted-by: nelson@uncecs.edu (jim nelson)
  8. Archive-name: help.jn
  9.  
  10. Here is a little Help-facility somewhat like some other operating
  11. systems provide.  It's sorta crude at the moment, but it works well.
  12. It runs under BSD, Xenix, and SysV, although I still don't know quite
  13. how to do "my own pager" under Xenix or SysV.  If this has been done
  14. before in the recent past, don't post, just trash.  However, I kinda
  15. like it, and we (I) plan to spring it on our freshmen due to arrive in
  16. a couple of weeks.
  17. ---------------- cut here -----------------
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 1 (of 1)."
  25. # Contents:  C-mistakes.txt MANIFEST Makefile README ac.txt af.txt
  26. #   ap.txt apropos.txt bye.txt cat.txt cbreak.c cc.txt cd.txt
  27. #   compilers.txt copy.txt cp.txt csh.txt dir.txt ed.txt edit.txt
  28. #   exit.txt files files.txt files/a.out.txt files/binaries
  29. #   files/binaries.txt files/binaries/a.out.txt
  30. #   files/binaries/executables.txt files/filenames.txt files/pwd.txt
  31. #   files/sources.txt fortran.txt games.txt guru guru.1 guru.txt
  32. #   help.c help.txt igors igors.1 igors.txt kindex.c languages.txt
  33. #   learn.txt less.txt listfd.c listit.c logoff.txt logout.txt
  34. #   mail.txt man.txt manual.txt mv.txt mymode.c news.txt nocbreak.c
  35. #   off.txt pascal.txt passwd.txt phone.txt pwd.txt quit.txt
  36. #   rename.txt stat.c talk.txt terminal.txt test.txt ulgrp vi.txt
  37. # Wrapped by nelson@uncw on Fri Aug 11 19:08:51 1989
  38. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  39. if test -f 'C-mistakes.txt' -a "${1}" != "-c" ; then 
  40.   echo shar: Will not clobber existing file \"'C-mistakes.txt'\"
  41. else
  42. echo shar: Extracting \"'C-mistakes.txt'\" \(3196 characters\)
  43. sed "s/^X//" >'C-mistakes.txt' <<'END_OF_FILE'
  44. X
  45. XA few of Dr. Doom's list of C-gotchas, condensed considerably from the
  46. Xoriginals:
  47. X
  48. X1.  EOF is an int, not a char; "getchar()", despite its
  49. Xcharacter-sounding name, RETURNS AN INT!  In fact, all functions in the
  50. XC language return either an int or a double; it is not possible to
  51. Xwrite a function which returns a char.  Besides, the compiler generates
  52. Xcode which takes the same amount of space for (scalar) chars and ints.
  53. XSo: there is NEVER any reason to say, for example: "char c;".  You
  54. Xshould ALWAYS declare c to be an int, especially when it receives the
  55. Xreturn value from getchar, which is then compared to EOF.
  56. X
  57. XExamples:
  58. X
  59. X    /* this is WRONG (WRONG!, WRONG!, WRONG! ...*/
  60. X    char c;
  61. X    while(  (c=getchar()) != EOF){ ... }
  62. X
  63. X    /* this is RIGHT */
  64. X    int c;
  65. X    while(  (c=getchar()) != EOF){ ... }
  66. X
  67. X----------------------------------------------------
  68. X
  69. X2.  Beware the distinction between "=" and "==".  The single-
  70. Xequal-sign (we'll call it SE) causes the things on the two sides of it
  71. Xto BECOME equal; the resultant value is then whatever value was
  72. Xoriginally on the right-hand-side of the SE operator.  The double-equal
  73. Xsign (DE) first tests the two sides to see if they are equal; the
  74. Xresulting value of the DE operator is zero if they are not equal, and
  75. Xone if they are equal.  No other results are possible.  
  76. X
  77. XExamples:
  78. X
  79. X    /* this is (probably) WRONG */
  80. X    int i,j;
  81. X    if(i=j){ ... }  /*will execute if j is nonzero */
  82. X
  83. X    /* this is (probably) RIGHT */
  84. X    int i,j;
  85. X    if(i==j){ ... } /*will execute if i is equal to j */
  86. X
  87. X----------------------------------------------------
  88. X
  89. X3.  Even experienced programmers sometimes forget the "&"s which
  90. Xare required on the arguments to scanf.  All arguments after the
  91. Xfirst must have "&" in front of it.
  92. X
  93. XExamples:
  94. X    /* WRONG ... guaranteed to dump core */
  95. X    int i;
  96. X    scanf("%d",i);
  97. X
  98. X    /* RIGHT */
  99. X    int i;
  100. X    scanf("%d",&i);
  101. X
  102. X    /* for advanced students only: */
  103. X    int j, *i = &j;
  104. X    scanf("%d",i);
  105. X    printf("%d %d\n",i,j); /* what does it print? */
  106. X
  107. X----------------------------------------------------
  108. X
  109. X4.  Beware the extraneous semicolon.
  110. X
  111. X    /* (probably) WRONG */
  112. X    for(i=0; i<10; i++);
  113. X        printf("%d\n",i);
  114. X
  115. X    /* (probably) RIGHT */
  116. X    for(i=0; i<10; i++)
  117. X        printf("%d\n",i);
  118. X
  119. X----------------------------------------------------
  120. X
  121. X5.  Again, even experienced programmers sometimes (Hi, Chris!)
  122. Xget bit by the "dangling else" bug:
  123. X
  124. X    if(i==5)
  125. X        k=7;
  126. X        if (line==27) d = 39;
  127. X    else
  128. X        d = 41;
  129. X
  130. Xand variations too numerous to show here.  The "else" goes with the
  131. Xnearest preceding "if" (well, actually, the nearest preceding
  132. X"if" that doesn't already have an "else" associated with it).  
  133. XThe compiler does not know indentation.
  134. X
  135. X----------------------------------------------------
  136. X
  137. X6.  Scanf() from the terminal can produce some perplexing results
  138. Xuntil you learn about "the terminating newline", and what scanf
  139. Xconsiders to be whitespace for %d, %s, and %c formats.  Primarily
  140. Xtry to remember that for a "%d" format, scanf IGNORES leading
  141. Xwhitespace, and PUTS BACK the whitespace which caused the termination
  142. Xof a "%d" scan.  Moral of the story: "do not mix %c and %s formats
  143. Xwith %d or %f formats, nor mix scanf with getchar, unless you are
  144. Xvery careful AND know what you're doing."
  145. END_OF_FILE
  146. if test 3196 -ne `wc -c <'C-mistakes.txt'`; then
  147.     echo shar: \"'C-mistakes.txt'\" unpacked with wrong size!
  148. fi
  149. # end of 'C-mistakes.txt'
  150. fi
  151. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  152.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  153. else
  154. echo shar: Extracting \"'MANIFEST'\" \(2258 characters\)
  155. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  156. X   File Name        Archive #    Description
  157. X-----------------------------------------------------------
  158. X C-mistakes.txt             1    
  159. X MANIFEST                   1    This shipping list
  160. X Makefile                   1    
  161. X README                     1    
  162. X ac.txt                     1    
  163. X af.txt                     1    
  164. X ap.txt                     1    
  165. X apropos.txt                1    
  166. X bye.txt                    1    
  167. X cat.txt                    1    
  168. X cbreak.c                   1    
  169. X cc.txt                     1    
  170. X cd.txt                     1    
  171. X compilers.txt              1    
  172. X copy.txt                   1    
  173. X cp.txt                     1    
  174. X csh.txt                    1    
  175. X dir.txt                    1    
  176. X ed.txt                     1    
  177. X edit.txt                   1    
  178. X exit.txt                   1    
  179. X files                      1    
  180. X files.txt                  1    
  181. X files/a.out.txt            1    
  182. X files/binaries             1    
  183. X files/binaries.txt         1    
  184. X files/binaries/a.out.txt   1    
  185. X files/binaries/executables.txt  1    
  186. X files/filenames.txt        1    
  187. X files/pwd.txt              1    
  188. X files/sources.txt          1    
  189. X fortran.txt                1    
  190. X games.txt                  1    
  191. X guru                       1    
  192. X guru.1                     1    
  193. X guru.txt                   1    
  194. X help.c                     1    
  195. X help.txt                   1    
  196. X igors                      1    
  197. X igors.1                    1    
  198. X igors.txt                  1    
  199. X kindex.c                   1    
  200. X languages.txt              1    
  201. X learn.txt                  1    
  202. X less.txt                   1    
  203. X listfd.c                   1    
  204. X listit.c                   1    
  205. X logoff.txt                 1    
  206. X logout.txt                 1    
  207. X mail.txt                   1    
  208. X man.txt                    1    
  209. X manual.txt                 1    
  210. X mv.txt                     1    
  211. X mymode.c                   1    
  212. X news.txt                   1    
  213. X nocbreak.c                 1    
  214. X off.txt                    1    
  215. X pascal.txt                 1    
  216. X passwd.txt                 1    
  217. X phone.txt                  1    
  218. X pwd.txt                    1    
  219. X quit.txt                   1    
  220. X rename.txt                 1    
  221. X stat.c                     1    
  222. X talk.txt                   1    
  223. X terminal.txt               1    
  224. X test.txt                   1    
  225. X ulgrp                      1    
  226. X vi.txt                     1    
  227. END_OF_FILE
  228. if test 2258 -ne `wc -c <'MANIFEST'`; then
  229.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  230. fi
  231. # end of 'MANIFEST'
  232. fi
  233. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  234.   echo shar: Will not clobber existing file \"'Makefile'\"
  235. else
  236. echo shar: Extracting \"'Makefile'\" \(1399 characters\)
  237. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  238. X#Makefile for "help"
  239. X
  240. X#for Sequent parallel make:
  241. XP=&
  242. X
  243. X#Define OLDDIR if you do not have opendir(), readdir(), etc.,
  244. X# and your directories are of the 16-byte, 14-character-name variety.
  245. X#Define SYSV if you must :-).
  246. X#Note that SYSV and OLDDIR are not necessarily related;
  247. X# at least one version of Xenix that I know of requires both,
  248. X# and at least one version of SysV has the new directory stuff.
  249. XCFLAGS=#-O #-DSYSV #-DOLDDIR
  250. X#CC=gcc
  251. X
  252. X
  253. X#directory where the "*.txt" files should live (most people would
  254. X# use /usr/lib/help, but it really doesn't matter).
  255. XLIB=/usr/lib/help
  256. X#the full pathname of the executable (in everyone's path (?)).
  257. XEXE=/usr/local/bin/help
  258. X
  259. XSRC= help.c mymode.c listfd.c kindex.c listit.c cbreak.c nocbreak.c
  260. XBIN= help.o mymode.o listfd.o kindex.o listit.o cbreak.o nocbreak.o
  261. Xhelpx: $(P) $(BIN)
  262. X    $(CC) -o helpx $(BIN)
  263. Xinstall: helpx
  264. X    strip helpx
  265. X    mv helpx $(EXE)
  266. X    -mkdir $(LIB)
  267. X    -mkdir $(LIB)/files
  268. X    -mkdir $(LIB)/files/binaries
  269. X    -cp ./*.txt $(LIB)
  270. X    -cp ./files/*.txt $(LIB)/files
  271. X    -cp ./files/binaries/*.txt $(LIB)/files/binaries
  272. X    -cp *.1 /usr/man/man1
  273. X
  274. Xlint: $(SRC)
  275. X    lint $(CFLAGS) -DLIBDIR=\"$(LIB)\" -cpbh $(SRC) 
  276. X    lint -cpbh stat.c
  277. Xshar:
  278. X    makekit -m README Makefile $(SRC) *.txt stat.c \
  279. X    files files/*.txt \
  280. X    files/binaries files/binaries/*.txt \
  281. X    guru.1 igors.1 guru igors ulgrp
  282. Xhelp.o: help.c
  283. X    $(CC) -c $(CFLAGS) -DLIBDIR=\"$(LIB)\" help.c
  284. Xclean:
  285. X    /bin/rm -f *.o helpx
  286. END_OF_FILE
  287. if test 1399 -ne `wc -c <'Makefile'`; then
  288.     echo shar: \"'Makefile'\" unpacked with wrong size!
  289. fi
  290. # end of 'Makefile'
  291. fi
  292. if test -f 'README' -a "${1}" != "-c" ; then 
  293.   echo shar: Will not clobber existing file \"'README'\"
  294. else
  295. echo shar: Extracting \"'README'\" \(2264 characters\)
  296. sed "s/^X//" >'README' <<'END_OF_FILE'
  297. X
  298. XA cheap/simple/quick/dirty HELP facility for Unix.
  299. X
  300. XThe maintainer need only add ".txt" files with the proper name
  301. Xin the proper place in order to add help-blurbs.  It has hierarchial
  302. X"Further help on ..." implemented by the hierarchial file structure
  303. Xof the directory in which the help-files live. Also, the man-pages
  304. Xare available from within the facility, without dropping back
  305. Xto the shell level.
  306. X
  307. XTwo compile-time options: SYSV and OLDDIR, in the CFLAGS= line 
  308. Xof the Makefile.
  309. X
  310. XTo make:  look at the first thirty or so lines of Makefile.
  311. XThen make.  Then make install.
  312. X
  313. XIt has been tested and works on:
  314. X1)  Sequent Dynix 3.0.14 (BSD4.2 knockoff), and
  315. X2)  SysV on an AT&T 6386 box (SysV version unknown, but it 
  316. X    did have the new-directory goodies), and
  317. X3)  Xenix on a Tandy box.  Mostly SysV, but without the directory
  318. X    goodies.
  319. X
  320. XBut one note of warning:  I've included my "Sequent with cc" versions
  321. Xof cbreak() and nocbreak().  They most likely will not work for you.
  322. XThey don't even work for me even using the gcc compiler.  This is
  323. Xbecause of some weird property of the cc preprocessor dealing with
  324. XTIOCGETP and TIOCSETP macros.  The header files make sendmail.cf look
  325. Xlike a McGuffey's Reader.  If you want to save your users a few
  326. Xkeystrokes at the --more-- prompt, figure out how to do it on YOUR
  327. Xsystem.  Try crmode(), etc., with the curses/termcap/termlib libraries,
  328. Xif you have them.  I wash my hands of the whole thing.  The "eat
  329. Xuntil newline" nocbreak() I send seems to work ok, but not pleasing.
  330. X
  331. XYou may have to become root if you want to install the executable in
  332. Xeverybody's path; otherwise no big deal.  The data files can live
  333. Xanywhere you decide to put them.  
  334. X
  335. XN.B.: I'm sure this has been done somewhere, sometime, many times
  336. Xbefore, and can be had on some DECUS tape or USENIX tape or can be
  337. Xftp'ed from xx.xx.xx.xx, etc., but what the heck, here it is, trash it
  338. Xif it's worthless, the price is right!  I wrote it because I didn't
  339. Xhave access to said sources, etc., and besides, it was fun.  Public
  340. XDomain.  jhn -- 11 Aug 89.
  341. X -- 
  342. XJim Nelson,UNC-Wilmington,Mathematical Sciences Dept,
  343. X919-395-3300 nelson@uncw.uucp or nelson@ecsvax.uncecs.edu or
  344. Xnelson@ecsvax.bitnet or {...,mcnc}!ecsvax!nelson 
  345. Xor {...,mcnc}!ecsvax!uncw!nelson
  346. END_OF_FILE
  347. if test 2264 -ne `wc -c <'README'`; then
  348.     echo shar: \"'README'\" unpacked with wrong size!
  349. fi
  350. # end of 'README'
  351. fi
  352. if test -f 'ac.txt' -a "${1}" != "-c" ; then 
  353.   echo shar: Will not clobber existing file \"'ac.txt'\"
  354. else
  355. echo shar: Extracting \"'ac.txt'\" \(518 characters\)
  356. sed "s/^X//" >'ac.txt' <<'END_OF_FILE'
  357. XThe three programs "ap", "ac", and "af", are somewhat reminiscent
  358. Xof PC compilers, in that they will compile, edit, compile, edit,
  359. Xcompile, edit, ... ad nauseam, without ever dropping you back to
  360. Xthe shell.  They also (and here is their usefulness) merge your
  361. Xerror messages back into your source file, let you fix your
  362. Xsource, and then remove the messages, all by black magic!  Authored
  363. Xby Dr. Doom in response to the the "draw a little hand with a finger
  364. Xpointing to the mistake" syndrome of some popular computers.
  365. END_OF_FILE
  366. if test 518 -ne `wc -c <'ac.txt'`; then
  367.     echo shar: \"'ac.txt'\" unpacked with wrong size!
  368. fi
  369. # end of 'ac.txt'
  370. fi
  371. if test -f 'af.txt' -a "${1}" != "-c" ; then 
  372.   echo shar: Will not clobber existing file \"'af.txt'\"
  373. else
  374. echo shar: Extracting \"'af.txt'\" \(518 characters\)
  375. sed "s/^X//" >'af.txt' <<'END_OF_FILE'
  376. XThe three programs "ap", "ac", and "af", are somewhat reminiscent
  377. Xof PC compilers, in that they will compile, edit, compile, edit,
  378. Xcompile, edit, ... ad nauseam, without ever dropping you back to
  379. Xthe shell.  They also (and here is their usefulness) merge your
  380. Xerror messages back into your source file, let you fix your
  381. Xsource, and then remove the messages, all by black magic!  Authored
  382. Xby Dr. Doom in response to the the "draw a little hand with a finger
  383. Xpointing to the mistake" syndrome of some popular computers.
  384. END_OF_FILE
  385. if test 518 -ne `wc -c <'af.txt'`; then
  386.     echo shar: \"'af.txt'\" unpacked with wrong size!
  387. fi
  388. # end of 'af.txt'
  389. fi
  390. if test -f 'ap.txt' -a "${1}" != "-c" ; then 
  391.   echo shar: Will not clobber existing file \"'ap.txt'\"
  392. else
  393. echo shar: Extracting \"'ap.txt'\" \(518 characters\)
  394. sed "s/^X//" >'ap.txt' <<'END_OF_FILE'
  395. XThe three programs "ap", "ac", and "af", are somewhat reminiscent
  396. Xof PC compilers, in that they will compile, edit, compile, edit,
  397. Xcompile, edit, ... ad nauseam, without ever dropping you back to
  398. Xthe shell.  They also (and here is their usefulness) merge your
  399. Xerror messages back into your source file, let you fix your
  400. Xsource, and then remove the messages, all by black magic!  Authored
  401. Xby Dr. Doom in response to the the "draw a little hand with a finger
  402. Xpointing to the mistake" syndrome of some popular computers.
  403. END_OF_FILE
  404. if test 518 -ne `wc -c <'ap.txt'`; then
  405.     echo shar: \"'ap.txt'\" unpacked with wrong size!
  406. fi
  407. # end of 'ap.txt'
  408. fi
  409. if test -f 'apropos.txt' -a "${1}" != "-c" ; then 
  410.   echo shar: Will not clobber existing file \"'apropos.txt'\"
  411. else
  412. echo shar: Extracting \"'apropos.txt'\" \(151 characters\)
  413. sed "s/^X//" >'apropos.txt' <<'END_OF_FILE'
  414. XApropos will search the title lines of the manual pages looking
  415. Xfor a keyword.  It will then tell you those commands which are
  416. Xfound.  See also "man".
  417. END_OF_FILE
  418. if test 151 -ne `wc -c <'apropos.txt'`; then
  419.     echo shar: \"'apropos.txt'\" unpacked with wrong size!
  420. fi
  421. # end of 'apropos.txt'
  422. fi
  423. if test -f 'bye.txt' -a "${1}" != "-c" ; then 
  424.   echo shar: Will not clobber existing file \"'bye.txt'\"
  425. else
  426. echo shar: Extracting \"'bye.txt'\" \(273 characters\)
  427. sed "s/^X//" >'bye.txt' <<'END_OF_FILE'
  428. XYou log off the Unix machines by typing control-d at the
  429. Xcommand line prompt.  (To type control-d, you HOLD DOWN the
  430. X"control" key WHILE typing "d"; this is not a two-stroke
  431. Xsequence -- it's a one-keystroke sequence made by holding
  432. Xdown the first while typing the second).
  433. END_OF_FILE
  434. if test 273 -ne `wc -c <'bye.txt'`; then
  435.     echo shar: \"'bye.txt'\" unpacked with wrong size!
  436. fi
  437. # end of 'bye.txt'
  438. fi
  439. if test -f 'cat.txt' -a "${1}" != "-c" ; then 
  440.   echo shar: Will not clobber existing file \"'cat.txt'\"
  441. else
  442. echo shar: Extracting \"'cat.txt'\" \(212 characters\)
  443. sed "s/^X//" >'cat.txt' <<'END_OF_FILE'
  444. XThe program to "concatenate" multiple files is called "cat".
  445. XUsage:
  446. X$ cat file1 file2 file3 ... > outputfile
  447. X
  448. XBe careful that "outputfile" is not the same as any of the other
  449. Xfiles.  If it is, it will be LOST!!
  450. X
  451. END_OF_FILE
  452. if test 212 -ne `wc -c <'cat.txt'`; then
  453.     echo shar: \"'cat.txt'\" unpacked with wrong size!
  454. fi
  455. # end of 'cat.txt'
  456. fi
  457. if test -f 'cbreak.c' -a "${1}" != "-c" ; then 
  458.   echo shar: Will not clobber existing file \"'cbreak.c'\"
  459. else
  460. echo shar: Extracting \"'cbreak.c'\" \(490 characters\)
  461. sed "s/^X//" >'cbreak.c' <<'END_OF_FILE'
  462. X#ifdef sequent
  463. X#include <stdio.h>
  464. X#include <sgtty.h>
  465. X
  466. Xcbreak()
  467. X{
  468. X    int i;
  469. X    extern int errno;
  470. X    struct sgttyb ttystatus;
  471. X    char *a;
  472. X    /* it is seemingly impossible to get lint to shut
  473. X    up about this: */
  474. X    a= &ttystatus.sg_ispeed;
  475. X    errno=0;
  476. X    i=ioctl(0,TIOCGETP,a);
  477. X    if(i<0)
  478. X    {int me;me=errno;fprintf(stderr,"errno %d\n",me);exit(3);}
  479. X
  480. X#define F    ttystatus.sg_flags
  481. X    F |= CBREAK;
  482. X    i=ioctl(0,TIOCSETP,a);
  483. X    if(i<0)
  484. X    {int me;me=errno;fprintf(stderr,"errno %d\n",me);exit(4);}
  485. X}
  486. X#else
  487. Xcbreak(){}
  488. X#endif
  489. END_OF_FILE
  490. if test 490 -ne `wc -c <'cbreak.c'`; then
  491.     echo shar: \"'cbreak.c'\" unpacked with wrong size!
  492. fi
  493. # end of 'cbreak.c'
  494. fi
  495. if test -f 'cc.txt' -a "${1}" != "-c" ; then 
  496.   echo shar: Will not clobber existing file \"'cc.txt'\"
  497. else
  498. echo shar: Extracting \"'cc.txt'\" \(155 characters\)
  499. sed "s/^X//" >'cc.txt' <<'END_OF_FILE'
  500. XThe command to compile a C-language program is
  501. X$ cc filename.c
  502. XThe resulting executable will be left in "a.out" in your directory.
  503. XTo run it, type
  504. X$ a.out
  505. END_OF_FILE
  506. if test 155 -ne `wc -c <'cc.txt'`; then
  507.     echo shar: \"'cc.txt'\" unpacked with wrong size!
  508. fi
  509. # end of 'cc.txt'
  510. fi
  511. if test -f 'cd.txt' -a "${1}" != "-c" ; then 
  512.   echo shar: Will not clobber existing file \"'cd.txt'\"
  513. else
  514. echo shar: Extracting \"'cd.txt'\" \(269 characters\)
  515. sed "s/^X//" >'cd.txt' <<'END_OF_FILE'
  516. X"cd" means "change directory".  That is, change to that directory
  517. Xso that it becomes the default directory.  Usage example:
  518. X% cd /usr2/nelson
  519. Xcauses all further commands which refer to the default directory
  520. Xto look in /usr2/nelson first.  To return home, just say
  521. X% cd
  522. END_OF_FILE
  523. if test 269 -ne `wc -c <'cd.txt'`; then
  524.     echo shar: \"'cd.txt'\" unpacked with wrong size!
  525. fi
  526. # end of 'cd.txt'
  527. fi
  528. if test -f 'compilers.txt' -a "${1}" != "-c" ; then 
  529.   echo shar: Will not clobber existing file \"'compilers.txt'\"
  530. else
  531. echo shar: Extracting \"'compilers.txt'\" \(283 characters\)
  532. sed "s/^X//" >'compilers.txt' <<'END_OF_FILE'
  533. XThere are three officially supported languages on this machine:
  534. XFORTRAN, C, and Pascal.  Ada is on loan from Sequent, and may
  535. Xbe returned at any time.  Awk and Perl may be considered by some
  536. Xto be languages.  We do not have BASIC, nor are we ever likely to.
  537. XC++ may be coming later.
  538. END_OF_FILE
  539. if test 283 -ne `wc -c <'compilers.txt'`; then
  540.     echo shar: \"'compilers.txt'\" unpacked with wrong size!
  541. fi
  542. # end of 'compilers.txt'
  543. fi
  544. if test -f 'copy.txt' -a "${1}" != "-c" ; then 
  545.   echo shar: Will not clobber existing file \"'copy.txt'\"
  546. else
  547. echo shar: Extracting \"'copy.txt'\" \(81 characters\)
  548. sed "s/^X//" >'copy.txt' <<'END_OF_FILE'
  549. XCopying is done by the "cp" command, which has the following usage:
  550. X$ cp from to
  551. END_OF_FILE
  552. if test 81 -ne `wc -c <'copy.txt'`; then
  553.     echo shar: \"'copy.txt'\" unpacked with wrong size!
  554. fi
  555. # end of 'copy.txt'
  556. fi
  557. if test -f 'cp.txt' -a "${1}" != "-c" ; then 
  558.   echo shar: Will not clobber existing file \"'cp.txt'\"
  559. else
  560. echo shar: Extracting \"'cp.txt'\" \(81 characters\)
  561. sed "s/^X//" >'cp.txt' <<'END_OF_FILE'
  562. XCopying is done by the "cp" command, which has the following usage:
  563. X$ cp from to
  564. END_OF_FILE
  565. if test 81 -ne `wc -c <'cp.txt'`; then
  566.     echo shar: \"'cp.txt'\" unpacked with wrong size!
  567. fi
  568. # end of 'cp.txt'
  569. fi
  570. if test -f 'csh.txt' -a "${1}" != "-c" ; then 
  571.   echo shar: Will not clobber existing file \"'csh.txt'\"
  572. else
  573. echo shar: Extracting \"'csh.txt'\" \(187 characters\)
  574. sed "s/^X//" >'csh.txt' <<'END_OF_FILE'
  575. XCsh is the command-line interpreter.  It is to Unix what DCL is
  576. X(feebly) to VMS.  It has history and command-line substitution
  577. Xfeatures.  Consult a Guru for neato tricks to try with csh.
  578. END_OF_FILE
  579. if test 187 -ne `wc -c <'csh.txt'`; then
  580.     echo shar: \"'csh.txt'\" unpacked with wrong size!
  581. fi
  582. # end of 'csh.txt'
  583. fi
  584. if test -f 'dir.txt' -a "${1}" != "-c" ; then 
  585.   echo shar: Will not clobber existing file \"'dir.txt'\"
  586. else
  587. echo shar: Extracting \"'dir.txt'\" \(107 characters\)
  588. sed "s/^X//" >'dir.txt' <<'END_OF_FILE'
  589. XTo list the files in your directory, use one of:
  590. X% l
  591. Xor
  592. X% ll
  593. Xor
  594. X% ls
  595. X(try them all to see the difference).
  596. END_OF_FILE
  597. if test 107 -ne `wc -c <'dir.txt'`; then
  598.     echo shar: \"'dir.txt'\" unpacked with wrong size!
  599. fi
  600. # end of 'dir.txt'
  601. fi
  602. if test -f 'ed.txt' -a "${1}" != "-c" ; then 
  603.   echo shar: Will not clobber existing file \"'ed.txt'\"
  604. else
  605. echo shar: Extracting \"'ed.txt'\" \(110 characters\)
  606. sed "s/^X//" >'ed.txt' <<'END_OF_FILE'
  607. X"ed" is the old, old, line-oriented editor.  Vi is the
  608. Xpreferred editor.  Select vi at the next help prompt.
  609. X
  610. END_OF_FILE
  611. if test 110 -ne `wc -c <'ed.txt'`; then
  612.     echo shar: \"'ed.txt'\" unpacked with wrong size!
  613. fi
  614. # end of 'ed.txt'
  615. fi
  616. if test -f 'edit.txt' -a "${1}" != "-c" ; then 
  617.   echo shar: Will not clobber existing file \"'edit.txt'\"
  618. else
  619. echo shar: Extracting \"'edit.txt'\" \(85 characters\)
  620. sed "s/^X//" >'edit.txt' <<'END_OF_FILE'
  621. XThe editor on the Unix machines is called "vi".  For more help
  622. Xask for help on "vi".
  623. END_OF_FILE
  624. if test 85 -ne `wc -c <'edit.txt'`; then
  625.     echo shar: \"'edit.txt'\" unpacked with wrong size!
  626. fi
  627. # end of 'edit.txt'
  628. fi
  629. if test -f 'exit.txt' -a "${1}" != "-c" ; then 
  630.   echo shar: Will not clobber existing file \"'exit.txt'\"
  631. else
  632. echo shar: Extracting \"'exit.txt'\" \(0 characters\)
  633. sed "s/^X//" >'exit.txt' <<'END_OF_FILE'
  634. END_OF_FILE
  635. if test 0 -ne `wc -c <'exit.txt'`; then
  636.     echo shar: \"'exit.txt'\" unpacked with wrong size!
  637. fi
  638. # end of 'exit.txt'
  639. fi
  640. if test ! -d 'files' ; then
  641.     echo shar: Creating directory \"'files'\"
  642.     mkdir 'files'
  643. fi
  644. if test -f 'files.txt' -a "${1}" != "-c" ; then 
  645.   echo shar: Will not clobber existing file \"'files.txt'\"
  646. else
  647. echo shar: Extracting \"'files.txt'\" \(244 characters\)
  648. sed "s/^X//" >'files.txt' <<'END_OF_FILE'
  649. XFiles are stored in a hierarchial manner, beginning with / as the
  650. Xroot of the filesystem.  The major subdivisions are /usr, /usr1,
  651. X/usr2, and /usr3.  Your directory is probably something like
  652. X/usr3/myname or something similar.
  653. X
  654. XSee also "pwd".
  655. END_OF_FILE
  656. if test 244 -ne `wc -c <'files.txt'`; then
  657.     echo shar: \"'files.txt'\" unpacked with wrong size!
  658. fi
  659. # end of 'files.txt'
  660. fi
  661. if test -f 'files/a.out.txt' -a "${1}" != "-c" ; then 
  662.   echo shar: Will not clobber existing file \"'files/a.out.txt'\"
  663. else
  664. echo shar: Extracting \"'files/a.out.txt'\" \(154 characters\)
  665. sed "s/^X//" >'files/a.out.txt' <<'END_OF_FILE'
  666. X"a.out" is the resultant executable file created by "cc",
  667. X"pascal", or "fortran".  (Its name is a historical accident --
  668. Xconsult a Guru for explanation.)
  669. END_OF_FILE
  670. if test 154 -ne `wc -c <'files/a.out.txt'`; then
  671.     echo shar: \"'files/a.out.txt'\" unpacked with wrong size!
  672. fi
  673. # end of 'files/a.out.txt'
  674. fi
  675. if test ! -d 'files/binaries' ; then
  676.     echo shar: Creating directory \"'files/binaries'\"
  677.     mkdir 'files/binaries'
  678. fi
  679. if test -f 'files/binaries.txt' -a "${1}" != "-c" ; then 
  680.   echo shar: Will not clobber existing file \"'files/binaries.txt'\"
  681. else
  682. echo shar: Extracting \"'files/binaries.txt'\" \(149 characters\)
  683. sed "s/^X//" >'files/binaries.txt' <<'END_OF_FILE'
  684. XBinary files typically are named ".o" files.  They are not normally
  685. Xleft lying around in your directory, except by certain programs,
  686. Xsuch as "make."
  687. END_OF_FILE
  688. if test 149 -ne `wc -c <'files/binaries.txt'`; then
  689.     echo shar: \"'files/binaries.txt'\" unpacked with wrong size!
  690. fi
  691. # end of 'files/binaries.txt'
  692. fi
  693. if test -f 'files/binaries/a.out.txt' -a "${1}" != "-c" ; then 
  694.   echo shar: Will not clobber existing file \"'files/binaries/a.out.txt'\"
  695. else
  696. echo shar: Extracting \"'files/binaries/a.out.txt'\" \(74 characters\)
  697. sed "s/^X//" >'files/binaries/a.out.txt' <<'END_OF_FILE'
  698. XExecutable files are by default named "a.out" and left in your
  699. Xdirectory.
  700. END_OF_FILE
  701. if test 74 -ne `wc -c <'files/binaries/a.out.txt'`; then
  702.     echo shar: \"'files/binaries/a.out.txt'\" unpacked with wrong size!
  703. fi
  704. # end of 'files/binaries/a.out.txt'
  705. fi
  706. if test -f 'files/binaries/executables.txt' -a "${1}" != "-c" ; then 
  707.   echo shar: Will not clobber existing file \"'files/binaries/executables.txt'\"
  708. else
  709. echo shar: Extracting \"'files/binaries/executables.txt'\" \(74 characters\)
  710. sed "s/^X//" >'files/binaries/executables.txt' <<'END_OF_FILE'
  711. XExecutable files are by default named "a.out" and left in your
  712. Xdirectory.
  713. END_OF_FILE
  714. if test 74 -ne `wc -c <'files/binaries/executables.txt'`; then
  715.     echo shar: \"'files/binaries/executables.txt'\" unpacked with wrong size!
  716. fi
  717. # end of 'files/binaries/executables.txt'
  718. fi
  719. if test -f 'files/filenames.txt' -a "${1}" != "-c" ; then 
  720.   echo shar: Will not clobber existing file \"'files/filenames.txt'\"
  721. else
  722. echo shar: Extracting \"'files/filenames.txt'\" \(532 characters\)
  723. sed "s/^X//" >'files/filenames.txt' <<'END_OF_FILE'
  724. XFilenames in Unix may be composed of any characters, even non-
  725. Xprinting characters (although not so useful).  However, conventionally,
  726. Xfilenames have an "extension" composed of the period and a descriptive
  727. Xcharacter or characters.  For example, C-language programs must
  728. Xbe named a name whose last two characters are ".c".  Note that this
  729. Xis not really an "extension"; it's just that the last two characters
  730. Xof the filename are "." and "c".  Pascal programs may be named
  731. Xending in ".pas" or ".p" .  Fortran programs must end in ".f"
  732. END_OF_FILE
  733. if test 532 -ne `wc -c <'files/filenames.txt'`; then
  734.     echo shar: \"'files/filenames.txt'\" unpacked with wrong size!
  735. fi
  736. # end of 'files/filenames.txt'
  737. fi
  738. if test -f 'files/pwd.txt' -a "${1}" != "-c" ; then 
  739.   echo shar: Will not clobber existing file \"'files/pwd.txt'\"
  740. else
  741. echo shar: Extracting \"'files/pwd.txt'\" \(132 characters\)
  742. sed "s/^X//" >'files/pwd.txt' <<'END_OF_FILE'
  743. XPwd tells you what directory is your current directory
  744. X("p"rint "w"orking "d"irectory).  This is how you
  745. X"find out where you are".
  746. X
  747. END_OF_FILE
  748. if test 132 -ne `wc -c <'files/pwd.txt'`; then
  749.     echo shar: \"'files/pwd.txt'\" unpacked with wrong size!
  750. fi
  751. # end of 'files/pwd.txt'
  752. fi
  753. if test -f 'files/sources.txt' -a "${1}" != "-c" ; then 
  754.   echo shar: Will not clobber existing file \"'files/sources.txt'\"
  755. else
  756. echo shar: Extracting \"'files/sources.txt'\" \(640 characters\)
  757. sed "s/^X//" >'files/sources.txt' <<'END_OF_FILE'
  758. XSource files are usually created by typing them into the computer
  759. Xusing an editor, such as "vi".
  760. XSource files in the Pascal language must end with ".p" or ".pas".
  761. XSource files in the C language must end with ".c".
  762. XSource files in the FORTRAN language must end with ".f".
  763. XNote that these are not "extensions" (Unix has no concept of
  764. X"extensions").  They simply are the last few characters of
  765. Xthe filename.  Filenames may be up to 255 characters long (not
  766. Xrecommended) and may consist of any characters, although you'll
  767. Xhave trouble with the shell if you stick, for example, "&" or
  768. X"*" in any of your filenames; "." and "-" are fine, though.
  769. END_OF_FILE
  770. if test 640 -ne `wc -c <'files/sources.txt'`; then
  771.     echo shar: \"'files/sources.txt'\" unpacked with wrong size!
  772. fi
  773. # end of 'files/sources.txt'
  774. fi
  775. if test -f 'fortran.txt' -a "${1}" != "-c" ; then 
  776.   echo shar: Will not clobber existing file \"'fortran.txt'\"
  777. else
  778. echo shar: Extracting \"'fortran.txt'\" \(107 characters\)
  779. sed "s/^X//" >'fortran.txt' <<'END_OF_FILE'
  780. XThe fortran compiler is invoked by
  781. X$ fortran filename.f
  782. XThe executable is named "a.out" in your directory.
  783. END_OF_FILE
  784. if test 107 -ne `wc -c <'fortran.txt'`; then
  785.     echo shar: \"'fortran.txt'\" unpacked with wrong size!
  786. fi
  787. # end of 'fortran.txt'
  788. fi
  789. if test -f 'games.txt' -a "${1}" != "-c" ; then 
  790.   echo shar: Will not clobber existing file \"'games.txt'\"
  791. else
  792. echo shar: Extracting \"'games.txt'\" \(316 characters\)
  793. sed "s/^X//" >'games.txt' <<'END_OF_FILE'
  794. XWe have OODLES and OODLES of games (well, those that can be
  795. Xplayed on 24 line X 80 column terminals).  We got chess,
  796. Xbackgammon, hack, rogue, greed, and lots more.  To see
  797. Xwhat games you can play, type
  798. X% l /usr/games
  799. X
  800. XUsually, if it is an executable game, its name will end in *,
  801. Xso to play it, just type its name.
  802. X
  803. END_OF_FILE
  804. if test 316 -ne `wc -c <'games.txt'`; then
  805.     echo shar: \"'games.txt'\" unpacked with wrong size!
  806. fi
  807. # end of 'games.txt'
  808. fi
  809. if test -f 'guru' -a "${1}" != "-c" ; then 
  810.   echo shar: Will not clobber existing file \"'guru'\"
  811. else
  812. echo shar: Extracting \"'guru'\" \(23 characters\)
  813. sed "s/^X//" >'guru' <<'END_OF_FILE'
  814. Xulgrp 0 | grep -v root
  815. END_OF_FILE
  816. if test 23 -ne `wc -c <'guru'`; then
  817.     echo shar: \"'guru'\" unpacked with wrong size!
  818. fi
  819. chmod +x 'guru'
  820. # end of 'guru'
  821. fi
  822. if test -f 'guru.1' -a "${1}" != "-c" ; then 
  823.   echo shar: Will not clobber existing file \"'guru.1'\"
  824. else
  825. echo shar: Extracting \"'guru.1'\" \(229 characters\)
  826. sed "s/^X//" >'guru.1' <<'END_OF_FILE'
  827. X.TH GURU 1 Local
  828. X.UC 4
  829. X.SH NAME
  830. Xguru \-  Gurus list
  831. X.SH SYNOPSIS
  832. X.B guru
  833. X.SH DESCRIPTION
  834. XLooks in /etc/passwd for users with group id's of "root".
  835. X.SH AUTHOR
  836. XJ. Nelson, UNCW, 5 Jul 89
  837. X.SH BUGS
  838. XAlso reports Igors along with Guru.
  839. END_OF_FILE
  840. if test 229 -ne `wc -c <'guru.1'`; then
  841.     echo shar: \"'guru.1'\" unpacked with wrong size!
  842. fi
  843. # end of 'guru.1'
  844. fi
  845. if test -f 'guru.txt' -a "${1}" != "-c" ; then 
  846.   echo shar: Will not clobber existing file \"'guru.txt'\"
  847. else
  848. echo shar: Extracting \"'guru.txt'\" \(180 characters\)
  849. sed "s/^X//" >'guru.txt' <<'END_OF_FILE'
  850. XGurus are those professors and students who have transcended
  851. Xmere worldly OS and C-hacking and have achieved a higher plane.
  852. XFor a current list, consult a Guru.
  853. X
  854. XSee also "igors".
  855. END_OF_FILE
  856. if test 180 -ne `wc -c <'guru.txt'`; then
  857.     echo shar: \"'guru.txt'\" unpacked with wrong size!
  858. fi
  859. # end of 'guru.txt'
  860. fi
  861. if test -f 'help.c' -a "${1}" != "-c" ; then 
  862.   echo shar: Will not clobber existing file \"'help.c'\"
  863. else
  864. echo shar: Extracting \"'help.c'\" \(1512 characters\)
  865. sed "s/^X//" >'help.c' <<'END_OF_FILE'
  866. X#include <sys/types.h>
  867. X#include <sys/dir.h>
  868. X#include <stdio.h>
  869. X#include <string.h>
  870. Xchar *zork[300];
  871. Xmain(argc,argv)
  872. Xchar **argv;
  873. X{
  874. X    int arcnt,level,k;
  875. X    char line[133],fnd[133];
  876. X    k=chdir(LIBDIR);
  877. X    if(k<0)exit(1);
  878. X    level=0;
  879. X    arcnt=1;
  880. X    for(;;){
  881. X        if(arcnt>=argc)        {
  882. X            puts("");
  883. X            if(level)printf("Further ");
  884. X            puts(
  885. X            "Help is available for the following topics:");
  886. X            if(listfd(1)<0)exit(1);
  887. X            printf("\nHelp on what topic? ");
  888. X            gets(line);
  889. X        }
  890. X        else{    
  891. X            printf("%s:\n",argv[arcnt]);
  892. X            if(listfd(0)<0)exit(1);
  893. X            strcpy(line,argv[arcnt]);
  894. X            arcnt++;
  895. X        }
  896. X        if(strlen(line)>0){
  897. X            k=completion(line,zork); 
  898. X            freezork(zork);
  899. X            if(!k)continue;
  900. X            if(!strcmp(line,"q") || 
  901. X                !strcmp(line,"quit") || 
  902. X                !strcmp(line,"exit"))exit(0);
  903. X            if(line[0]=='!'){
  904. X                strcpy(fnd,"man ");
  905. X                strcat(fnd,&line[1]);
  906. X                system(fnd);
  907. X                continue;
  908. X            }
  909. X        }
  910. X        if((k=strlen(line))==0 && level==0)exit(1);
  911. X        if(k==0){
  912. X            level--;
  913. X            chdir("..");
  914. X            continue;
  915. X        }
  916. X        strcpy(fnd,line);
  917. X        strcat(line,".txt");
  918. X        if(mymode(line)){
  919. X            if(listit(line)<0)exit(1);
  920. X        }
  921. X        if(mymode(fnd)&040000){
  922. X            /*            printf("\nFurther ");*/
  923. X            chdir(fnd);
  924. X            level++;
  925. X        }
  926. X    }
  927. X}
  928. Xfreezork(p)
  929. Xchar **p;
  930. X{
  931. X    while(*p){
  932. X        free(*p);
  933. X        *p = (char *)0;
  934. X        p++;
  935. X    }
  936. X}
  937. Xcompletion(line,p)
  938. Xchar *line;
  939. Xchar **p;
  940. X{
  941. X    int i,j,count=0;
  942. X    char *q;
  943. X    q=line;
  944. X    if(*q=='!')q++;
  945. X    for(i=0;p[i];i++)if(kindex(p[i],q)==0){
  946. X        if(strcmp(p[i],q)==0)return 1;
  947. X        count++;
  948. X        j=i;
  949. X    }
  950. X    if(count!=1){
  951. X        printf("ambiguous\n");
  952. X        return 0;
  953. X    }
  954. X    strcpy(q,p[j]);
  955. X    return 1;
  956. X
  957. X}
  958. X
  959. END_OF_FILE
  960. if test 1512 -ne `wc -c <'help.c'`; then
  961.     echo shar: \"'help.c'\" unpacked with wrong size!
  962. fi
  963. # end of 'help.c'
  964. fi
  965. if test -f 'help.txt' -a "${1}" != "-c" ; then 
  966.   echo shar: Will not clobber existing file \"'help.txt'\"
  967. else
  968. echo shar: Extracting \"'help.txt'\" \(284 characters\)
  969. sed "s/^X//" >'help.txt' <<'END_OF_FILE'
  970. XYou are using the help command right now.  To move down to sub-
  971. Xtopics, select the sub-topic; to move back up to the parent topic,
  972. Xjust type <return>.  To get the man-page for a topic, type
  973. X!topic (that is, for example, to get the man-page for "cp"),
  974. Xtype !cp at the "topic?" prompt.
  975. END_OF_FILE
  976. if test 284 -ne `wc -c <'help.txt'`; then
  977.     echo shar: \"'help.txt'\" unpacked with wrong size!
  978. fi
  979. # end of 'help.txt'
  980. fi
  981. if test -f 'igors' -a "${1}" != "-c" ; then 
  982.   echo shar: Will not clobber existing file \"'igors'\"
  983. else
  984. echo shar: Extracting \"'igors'\" \(23 characters\)
  985. sed "s/^X//" >'igors' <<'END_OF_FILE'
  986. Xulgrp 0 | grep -v root
  987. END_OF_FILE
  988. if test 23 -ne `wc -c <'igors'`; then
  989.     echo shar: \"'igors'\" unpacked with wrong size!
  990. fi
  991. chmod +x 'igors'
  992. # end of 'igors'
  993. fi
  994. if test -f 'igors.1' -a "${1}" != "-c" ; then 
  995.   echo shar: Will not clobber existing file \"'igors.1'\"
  996. else
  997. echo shar: Extracting \"'igors.1'\" \(383 characters\)
  998. sed "s/^X//" >'igors.1' <<'END_OF_FILE'
  999. X.TH IGORS 1 Local
  1000. X.UC 4
  1001. X.SH NAME
  1002. Xigors \- apprentice Gurus list
  1003. X.SH SYNOPSIS
  1004. X.B igors
  1005. X.SH DESCRIPTION
  1006. XLooks in /etc/passwd for users with group id's of "root".
  1007. X.SH AUTHOR
  1008. XJ. Nelson, UNCW, 5 Jul 89
  1009. X.SH BUGS
  1010. XAlso reports Gurus along with Igors. Igors are those who can
  1011. Xbe considered Gurus on some subjects but not others. Gurus
  1012. Xwill admit to no such limitation, rightly or wrongly ...
  1013. END_OF_FILE
  1014. if test 383 -ne `wc -c <'igors.1'`; then
  1015.     echo shar: \"'igors.1'\" unpacked with wrong size!
  1016. fi
  1017. # end of 'igors.1'
  1018. fi
  1019. if test -f 'igors.txt' -a "${1}" != "-c" ; then 
  1020.   echo shar: Will not clobber existing file \"'igors.txt'\"
  1021. else
  1022. echo shar: Extracting \"'igors.txt'\" \(156 characters\)
  1023. sed "s/^X//" >'igors.txt' <<'END_OF_FILE'
  1024. XThe "igors" are those students who classify as Gurus or
  1025. Xsemi-Gurus (as in "Igor! Fetch me a brain!).  For a current
  1026. Xlist, consult a Guru.
  1027. X
  1028. XSee also "guru".
  1029. END_OF_FILE
  1030. if test 156 -ne `wc -c <'igors.txt'`; then
  1031.     echo shar: \"'igors.txt'\" unpacked with wrong size!
  1032. fi
  1033. # end of 'igors.txt'
  1034. fi
  1035. if test -f 'kindex.c' -a "${1}" != "-c" ; then 
  1036.   echo shar: Will not clobber existing file \"'kindex.c'\"
  1037. else
  1038. echo shar: Extracting \"'kindex.c'\" \(427 characters\)
  1039. sed "s/^X//" >'kindex.c' <<'END_OF_FILE'
  1040. Xkindex(s,t) 
  1041. Xchar s[],t[];
  1042. X{
  1043. X    int c,i,j,k;
  1044. X    c=s[0];
  1045. X    if(c==0){return -1;
  1046. X/*        i=puts("in kindex ... dummy, s[0] is zero");j=i;*/
  1047. X/*        puts(t);*/
  1048. X/*        if(i==j)exit(1);*/
  1049. X        }
  1050. X    c=t[0];
  1051. X    if(c==0){return -1;
  1052. X/*    i=puts("in kindex ... dummy, t[0] is zero");j=i;*/
  1053. X/*        puts(s);*/
  1054. X/*        if(j==i)exit(1);*/
  1055. X        }
  1056. X    for(i=0;s[i] !='\0'; i++){
  1057. X        for(j=i,k=0;t[k] !='\0' && s[j]==t[k];j++,k++)
  1058. X                ;
  1059. X        if(t[k]=='\0')return (i);
  1060. X    }
  1061. X        return(-1);
  1062. X} 
  1063. END_OF_FILE
  1064. if test 427 -ne `wc -c <'kindex.c'`; then
  1065.     echo shar: \"'kindex.c'\" unpacked with wrong size!
  1066. fi
  1067. # end of 'kindex.c'
  1068. fi
  1069. if test -f 'languages.txt' -a "${1}" != "-c" ; then 
  1070.   echo shar: Will not clobber existing file \"'languages.txt'\"
  1071. else
  1072. echo shar: Extracting \"'languages.txt'\" \(283 characters\)
  1073. sed "s/^X//" >'languages.txt' <<'END_OF_FILE'
  1074. XThere are three officially supported languages on this machine:
  1075. XFORTRAN, C, and Pascal.  Ada is on loan from Sequent, and may
  1076. Xbe returned at any time.  Awk and Perl may be considered by some
  1077. Xto be languages.  We do not have BASIC, nor are we ever likely to.
  1078. XC++ may be coming later.
  1079. END_OF_FILE
  1080. if test 283 -ne `wc -c <'languages.txt'`; then
  1081.     echo shar: \"'languages.txt'\" unpacked with wrong size!
  1082. fi
  1083. # end of 'languages.txt'
  1084. fi
  1085. if test -f 'learn.txt' -a "${1}" != "-c" ; then 
  1086.   echo shar: Will not clobber existing file \"'learn.txt'\"
  1087. else
  1088. echo shar: Extracting \"'learn.txt'\" \(158 characters\)
  1089. sed "s/^X//" >'learn.txt' <<'END_OF_FILE'
  1090. XThe "learn" program is (designed to be) self-explanatory.  It has
  1091. Xa number of courses to learn about files, C, and so forth.  Type
  1092. X% learn
  1093. Xand go from there.
  1094. END_OF_FILE
  1095. if test 158 -ne `wc -c <'learn.txt'`; then
  1096.     echo shar: \"'learn.txt'\" unpacked with wrong size!
  1097. fi
  1098. # end of 'learn.txt'
  1099. fi
  1100. if test -f 'less.txt' -a "${1}" != "-c" ; then 
  1101.   echo shar: Will not clobber existing file \"'less.txt'\"
  1102. else
  1103. echo shar: Extracting \"'less.txt'\" \(251 characters\)
  1104. sed "s/^X//" >'less.txt' <<'END_OF_FILE'
  1105. X"less" is a nice program which copies text to the terminal a screenful
  1106. Xat a time, then awaits a command.  <space> goes on to the next
  1107. Xscreenful; "b" goes back one screenful; "G" goes to the end of
  1108. Xthe input file, etc.  For more info see the man-page.
  1109. END_OF_FILE
  1110. if test 251 -ne `wc -c <'less.txt'`; then
  1111.     echo shar: \"'less.txt'\" unpacked with wrong size!
  1112. fi
  1113. # end of 'less.txt'
  1114. fi
  1115. if test -f 'listfd.c' -a "${1}" != "-c" ; then 
  1116.   echo shar: Will not clobber existing file \"'listfd.c'\"
  1117. else
  1118. echo shar: Extracting \"'listfd.c'\" \(3730 characters\)
  1119. sed "s/^X//" >'listfd.c' <<'END_OF_FILE'
  1120. X#ifndef OLDDIR
  1121. X#include <sys/types.h>
  1122. X#include <stdio.h>
  1123. X#include <sys/stat.h>
  1124. X#include <string.h>
  1125. X#ifdef SYSV
  1126. X#include <dirent.h>
  1127. X#endif
  1128. X#include <sys/dir.h>
  1129. Xlistfd(yesprint)
  1130. X/* list files only of type "file" in the current directory */
  1131. X/* the "yesprint" thing is a horrible kludge, added to correct
  1132. X a horrible kludge when the filename-completion was added ...
  1133. X ad nauseam */
  1134. X{
  1135. X    DIR *dirp;
  1136. X    char line[233],fnmine[833];
  1137. X    int k;
  1138. X#ifdef SYSV
  1139. X    struct dirent dir, *p, *readdir();
  1140. X#else
  1141. X    struct direct dir, *p, *readdir();
  1142. X#endif
  1143. X    char *fn, *fgets();
  1144. X    extern char *zork[300];
  1145. X    int i;
  1146. X    char *malloc();
  1147. X
  1148. X
  1149. X    p= &dir;
  1150. X    dirp=opendir(".");
  1151. X    if(dirp==NULL){
  1152. X        return(-1);
  1153. X    }
  1154. X    line[0]=0;
  1155. X    i=0;
  1156. X    zork[i]=(char * )0;
  1157. X    while(p=readdir(dirp)) 
  1158. X    {
  1159. X        fn=p->d_name;
  1160. X        /*        fprintf(stderr,"fn=%x,p=%x,p->d_name=%x, *fn=%c\n",*/
  1161. X        /*        fn,p,p->d_name,*fn);*/
  1162. X        /*        {int i;for(i=0;i<5;i++)fprintf(stderr,"%o ",fn[i]);}*/
  1163. X        if(*fn=='.')continue;
  1164. X        if(mymode(fn)&040000) /*it's a dir*/continue;
  1165. X        if((k=kindex(fn,".txt"))<0)continue;
  1166. X        (void)strcpy(fnmine,fn);
  1167. X        fnmine[k]=0;
  1168. X        /*        puts(fnmine);*/
  1169. X        zork[i]=malloc((unsigned)strlen(fnmine)+1);
  1170. X        if(!zork[i])exit(1);
  1171. X        (void)strcpy(zork[i],fnmine);
  1172. X        /*        puts(zork[i]);*/
  1173. X        i++;
  1174. X        zork[i]=(char * )0;
  1175. X    }
  1176. X    closedir(dirp);
  1177. X    /*    puts(line);*/
  1178. X    mydumbsort(zork);
  1179. X    line[0]=0;
  1180. X    for(i=0;zork[i];i++)
  1181. X    {
  1182. X        int jim;
  1183. X        strcat(line,zork[i]);
  1184. X/*        free(zork[i]);*/
  1185. X        strcat(line," ");
  1186. X        jim=strlen(line);
  1187. X        if(jim>65){
  1188. X            if(yesprint)puts(line);
  1189. X            line[0]=0;
  1190. X        }
  1191. X        jim=strlen(line);
  1192. X        while(  (jim%9) ){
  1193. X            strcat(line," "); 
  1194. X            jim++;
  1195. X        }
  1196. X        if(jim>65){
  1197. X            if(yesprint)puts(line);
  1198. X            line[0]=0;
  1199. X        }
  1200. X        /*    if((i%5)==4){*/
  1201. X        /**/
  1202. X        /*            puts(line);*/
  1203. X        /*            line[0]=0;*/
  1204. X        /*        }*/
  1205. X
  1206. X    }
  1207. X    if(yesprint)puts(line);
  1208. X    return 1;    
  1209. X}
  1210. Xmydumbsort(p)
  1211. Xchar **p;
  1212. X{
  1213. X    /*dumb bubble sort of pointers*/
  1214. X    int i,j,n;
  1215. X    char *t;
  1216. X    if(p[0]==(char*)0)return; /*no elements*/
  1217. X    if(p[1]==(char*)0)return; /* one element*/
  1218. X    for(i=0;p[i];i++)   ;
  1219. X    n=i;
  1220. X    for(i=0;i<n-1;i++)
  1221. X        for(j=i+1;j<n;j++)
  1222. X            /*            if(*p[i]< *p[j]){*/
  1223. X            if(strcmp(p[i],p[j])>0){
  1224. X                t=p[i];
  1225. X                p[i]=p[j];
  1226. X                p[j]=t;
  1227. X
  1228. X            }
  1229. X
  1230. X}
  1231. X#else
  1232. X/* this is an entire replacement for listfd() for old-
  1233. Xstyle 14-character name, 2-byte inode no. style directories */
  1234. Xlistfd(yesprint)
  1235. X/* list files only of type "file" in the current directory */
  1236. X{
  1237. X    char line[233],fnmine[833];
  1238. X    int k;
  1239. X    char *fn, *fgets();
  1240. X    extern char *zork[300];
  1241. X    int i,fd;
  1242. X    char *malloc();
  1243. X    char mumble[17];
  1244. X
  1245. X
  1246. X    fd=open(".",0);
  1247. X
  1248. X    if(fd<0){
  1249. X        return(-1);
  1250. X    }
  1251. X    line[0]=0;
  1252. X    i=0;
  1253. X    zork[i]=(char * )0;
  1254. X    while( read(fd,mumble,16)==16) 
  1255. X    {
  1256. X        if(mumble[0]==0&&mumble[1]==0)continue;/*zeroed inode no.*/
  1257. X        fn= mumble+2;/*filename*/
  1258. X        mumble[16]=0;/*make sure null terminated*/
  1259. X        if(*fn=='.')continue;/*skip all dot files*/
  1260. X        if(mymode(fn)&040000) /*it's a dir*/continue;
  1261. X        if((k=kindex(fn,".txt"))<0)continue;
  1262. X        (void)strcpy(fnmine,fn);
  1263. X        fnmine[k]=0;
  1264. X        zork[i]=malloc((unsigned)strlen(fnmine)+1);
  1265. X        if(!zork[i])exit(1);
  1266. X        (void)strcpy(zork[i],fnmine);
  1267. X        i++;
  1268. X        zork[i]=(char * )0;
  1269. X    }/*end while*/
  1270. X    i=close(fd);
  1271. X    if(i<0)exit(7);
  1272. X    mydumbsort(zork);
  1273. X    line[0]=0;
  1274. X    for(i=0;zork[i];i++)
  1275. X    {
  1276. X        int jim;
  1277. X        strcat(line,zork[i]);
  1278. X/*        free(zork[i]);*/
  1279. X        strcat(line," ");
  1280. X        jim=strlen(line);
  1281. X        if(jim>65){
  1282. X            if(yesprint)puts(line);
  1283. X            line[0]=0;
  1284. X        }
  1285. X        jim=strlen(line);
  1286. X        while(  (jim%9) ){
  1287. X            strcat(line," "); 
  1288. X            jim++;
  1289. X        }
  1290. X        if(jim>65){
  1291. X            if(yesprint)puts(line);
  1292. X            line[0]=0;
  1293. X        }
  1294. X
  1295. X    }
  1296. X    if(yesprint)puts(line);
  1297. X    return 1;    
  1298. X}
  1299. Xmydumbsort(p)
  1300. Xchar **p;
  1301. X{
  1302. X    /*dumb bubble sort of pointers*/
  1303. X    int i,j,n;
  1304. X    char *t;
  1305. X    if(p[0]==(char*)0)return; /*no elements*/
  1306. X    if(p[1]==(char*)0)return; /* one element*/
  1307. X    for(i=0;p[i];i++)   ;
  1308. X    n=i;
  1309. X    for(i=0;i<n-1;i++)
  1310. X        for(j=i+1;j<n;j++)
  1311. X            if(strcmp(p[i],p[j])>0){
  1312. X                t=p[i];
  1313. X                p[i]=p[j];
  1314. X                p[j]=t;
  1315. X
  1316. X            }
  1317. X
  1318. X}
  1319. X#endif
  1320. END_OF_FILE
  1321. if test 3730 -ne `wc -c <'listfd.c'`; then
  1322.     echo shar: \"'listfd.c'\" unpacked with wrong size!
  1323. fi
  1324. # end of 'listfd.c'
  1325. fi
  1326. if test -f 'listit.c' -a "${1}" != "-c" ; then 
  1327.   echo shar: Will not clobber existing file \"'listit.c'\"
  1328. else
  1329. echo shar: Extracting \"'listit.c'\" \(454 characters\)
  1330. sed "s/^X//" >'listit.c' <<'END_OF_FILE'
  1331. X#include <stdio.h>
  1332. Xlistit(fn)
  1333. Xchar *fn;
  1334. X{
  1335. X    int i;
  1336. X    char line[153];
  1337. X    FILE *fp;
  1338. X    fp=fopen(fn,"r");
  1339. X    if(fp==(FILE *)0)return(-1);
  1340. X    puts("");
  1341. X    i=0;
  1342. X    while(fgets(line,132,fp)==line)
  1343. X    {
  1344. X        i++;
  1345. X        if(  (i%21)==0 ){
  1346. X            int c;
  1347. X            printf("---more---");
  1348. X            fflush(stdout);
  1349. X            cbreak();
  1350. X            c=getchar();
  1351. X            nocbreak();
  1352. X/*            puts("");*/
  1353. X            printf("\r           \r");
  1354. X            if(c=='q')goto out;
  1355. X
  1356. X        }
  1357. X        printf("%s",line);
  1358. X    }
  1359. Xout:
  1360. X    if(fp)if(fclose(fp)<0)exit(1);
  1361. X    return 0;
  1362. X}
  1363. END_OF_FILE
  1364. if test 454 -ne `wc -c <'listit.c'`; then
  1365.     echo shar: \"'listit.c'\" unpacked with wrong size!
  1366. fi
  1367. # end of 'listit.c'
  1368. fi
  1369. if test -f 'logoff.txt' -a "${1}" != "-c" ; then 
  1370.   echo shar: Will not clobber existing file \"'logoff.txt'\"
  1371. else
  1372. echo shar: Extracting \"'logoff.txt'\" \(273 characters\)
  1373. sed "s/^X//" >'logoff.txt' <<'END_OF_FILE'
  1374. XYou log off the Unix machines by typing control-d at the
  1375. Xcommand line prompt.  (To type control-d, you HOLD DOWN the
  1376. X"control" key WHILE typing "d"; this is not a two-stroke
  1377. Xsequence -- it's a one-keystroke sequence made by holding
  1378. Xdown the first while typing the second).
  1379. END_OF_FILE
  1380. if test 273 -ne `wc -c <'logoff.txt'`; then
  1381.     echo shar: \"'logoff.txt'\" unpacked with wrong size!
  1382. fi
  1383. # end of 'logoff.txt'
  1384. fi
  1385. if test -f 'logout.txt' -a "${1}" != "-c" ; then 
  1386.   echo shar: Will not clobber existing file \"'logout.txt'\"
  1387. else
  1388. echo shar: Extracting \"'logout.txt'\" \(273 characters\)
  1389. sed "s/^X//" >'logout.txt' <<'END_OF_FILE'
  1390. XYou log off the Unix machines by typing control-d at the
  1391. Xcommand line prompt.  (To type control-d, you HOLD DOWN the
  1392. X"control" key WHILE typing "d"; this is not a two-stroke
  1393. Xsequence -- it's a one-keystroke sequence made by holding
  1394. Xdown the first while typing the second).
  1395. END_OF_FILE
  1396. if test 273 -ne `wc -c <'logout.txt'`; then
  1397.     echo shar: \"'logout.txt'\" unpacked with wrong size!
  1398. fi
  1399. # end of 'logout.txt'
  1400. fi
  1401. if test -f 'mail.txt' -a "${1}" != "-c" ; then 
  1402.   echo shar: Will not clobber existing file \"'mail.txt'\"
  1403. else
  1404. echo shar: Extracting \"'mail.txt'\" \(420 characters\)
  1405. sed "s/^X//" >'mail.txt' <<'END_OF_FILE'
  1406. XMail is just that: mail a message to another user.  Mail will
  1407. Xboth send and receive mail.  Be advised, however, that mail
  1408. Xis NOT private.  It's more like a message-passing bulletin
  1409. Xboard.  Do not mail secret things.  Mail is most often used
  1410. Xby professors to mail assignments, etc., to classes.  Mail
  1411. Xalso can be used to send messages anywhere in the world.
  1412. XConsult a Guru for permission/how-to on this powerful feature.
  1413. END_OF_FILE
  1414. if test 420 -ne `wc -c <'mail.txt'`; then
  1415.     echo shar: \"'mail.txt'\" unpacked with wrong size!
  1416. fi
  1417. # end of 'mail.txt'
  1418. fi
  1419. if test -f 'man.txt' -a "${1}" != "-c" ; then 
  1420.   echo shar: Will not clobber existing file \"'man.txt'\"
  1421. else
  1422. echo shar: Extracting \"'man.txt'\" \(555 characters\)
  1423. sed "s/^X//" >'man.txt' <<'END_OF_FILE'
  1424. XUnix boxes which have sufficient disk storage (Hi, Doug!) keep
  1425. Xthe manual on disk.  Unix traditionally has what are called "the
  1426. Xman-pages".  Most programs have a one-page manual entry, although
  1427. Xin later years, some programs have come with fifty-page entries.
  1428. XTo get a manual page for a particular program, use
  1429. X$ man programname
  1430. X
  1431. XSee also "apropos".
  1432. X
  1433. XYou can get the manual page from within help by typing
  1434. X!subject when help asks for a topic (well, dummy, you
  1435. Xdon't actually type "subject"; you replace it with what
  1436. Xyou want the man page for ... hmmmph!).
  1437. END_OF_FILE
  1438. if test 555 -ne `wc -c <'man.txt'`; then
  1439.     echo shar: \"'man.txt'\" unpacked with wrong size!
  1440. fi
  1441. # end of 'man.txt'
  1442. fi
  1443. if test -f 'manual.txt' -a "${1}" != "-c" ; then 
  1444.   echo shar: Will not clobber existing file \"'manual.txt'\"
  1445. else
  1446. echo shar: Extracting \"'manual.txt'\" \(555 characters\)
  1447. sed "s/^X//" >'manual.txt' <<'END_OF_FILE'
  1448. XUnix boxes which have sufficient disk storage (Hi, Doug!) keep
  1449. Xthe manual on disk.  Unix traditionally has what are called "the
  1450. Xman-pages".  Most programs have a one-page manual entry, although
  1451. Xin later years, some programs have come with fifty-page entries.
  1452. XTo get a manual page for a particular program, use
  1453. X$ man programname
  1454. X
  1455. XSee also "apropos".
  1456. X
  1457. XYou can get the manual page from within help by typing
  1458. X!subject when help asks for a topic (well, dummy, you
  1459. Xdon't actually type "subject"; you replace it with what
  1460. Xyou want the man page for ... hmmmph!).
  1461. END_OF_FILE
  1462. if test 555 -ne `wc -c <'manual.txt'`; then
  1463.     echo shar: \"'manual.txt'\" unpacked with wrong size!
  1464. fi
  1465. # end of 'manual.txt'
  1466. fi
  1467. if test -f 'mv.txt' -a "${1}" != "-c" ; then 
  1468.   echo shar: Will not clobber existing file \"'mv.txt'\"
  1469. else
  1470. echo shar: Extracting \"'mv.txt'\" \(218 characters\)
  1471. sed "s/^X//" >'mv.txt' <<'END_OF_FILE'
  1472. XRename is accomplished by use of the "mv" command.  Don't ask
  1473. Xwhy the command is named "mv" instead of "rename", it just is.
  1474. XUsage:
  1475. X$ mv from to
  1476. Xeffectively renames "from" to be "to".
  1477. XIt does a copy and then a delete.
  1478. END_OF_FILE
  1479. if test 218 -ne `wc -c <'mv.txt'`; then
  1480.     echo shar: \"'mv.txt'\" unpacked with wrong size!
  1481. fi
  1482. # end of 'mv.txt'
  1483. fi
  1484. if test -f 'mymode.c' -a "${1}" != "-c" ; then 
  1485.   echo shar: Will not clobber existing file \"'mymode.c'\"
  1486. else
  1487. echo shar: Extracting \"'mymode.c'\" \(335 characters\)
  1488. sed "s/^X//" >'mymode.c' <<'END_OF_FILE'
  1489. X#include <stdio.h>
  1490. X#include <sys/types.h>
  1491. X#include <sys/stat.h>
  1492. X
  1493. Xmymode(p)
  1494. Xchar *p;
  1495. X{
  1496. X
  1497. X    struct stat buf;
  1498. X    struct stat *pb = &buf;
  1499. X#ifndef SYSV
  1500. X    if(lstat(p,pb)== -1)
  1501. X#else
  1502. X    if(stat(p,pb)== -1)
  1503. X#endif
  1504. X    {
  1505. X/*        fprintf(stderr,"lstat: %s not found\n",p);*/
  1506. X        return 0;
  1507. X    }
  1508. X/*    fprintf(stderr,"mode=%o\n",pb->st_mode);*/
  1509. X    return pb->st_mode;
  1510. X}
  1511. END_OF_FILE
  1512. if test 335 -ne `wc -c <'mymode.c'`; then
  1513.     echo shar: \"'mymode.c'\" unpacked with wrong size!
  1514. fi
  1515. # end of 'mymode.c'
  1516. fi
  1517. if test -f 'news.txt' -a "${1}" != "-c" ; then 
  1518.   echo shar: Will not clobber existing file \"'news.txt'\"
  1519. else
  1520. echo shar: Extracting \"'news.txt'\" \(526 characters\)
  1521. sed "s/^X//" >'news.txt' <<'END_OF_FILE'
  1522. XThe "news" refers to the posted articles in a network usually referred
  1523. Xto as "usenet".  These articles are arranged into a hierarchy of
  1524. Xsubjects, topics, etc., and come from all over the world.  UNCW
  1525. Xreceives the "news" from a big vax up in the Triangle every morning
  1526. Xbeginning at at 0249.  To read the news, you may use any one of several
  1527. X"news-reader" programs.  The two most popular seem to be "rn" and
  1528. X"nn".  I recommend "nn" for the beginner, as it is less formidable to
  1529. Xget started.  Just type 
  1530. X% nn 
  1531. Xand go from there.
  1532. END_OF_FILE
  1533. if test 526 -ne `wc -c <'news.txt'`; then
  1534.     echo shar: \"'news.txt'\" unpacked with wrong size!
  1535. fi
  1536. # end of 'news.txt'
  1537. fi
  1538. if test -f 'nocbreak.c' -a "${1}" != "-c" ; then 
  1539.   echo shar: Will not clobber existing file \"'nocbreak.c'\"
  1540. else
  1541. echo shar: Extracting \"'nocbreak.c'\" \(308 characters\)
  1542. sed "s/^X//" >'nocbreak.c' <<'END_OF_FILE'
  1543. X#ifdef sequent
  1544. X#include <sgtty.h>
  1545. X
  1546. Xnocbreak()
  1547. X{
  1548. X    int i;
  1549. X    struct sgttyb ttystatus;
  1550. X    char *a;
  1551. X    a= &ttystatus.sg_ispeed;
  1552. X    i=ioctl(0,TIOCGETP,a);
  1553. X    if(i<0)exit(5);
  1554. X
  1555. X#define F    ttystatus.sg_flags
  1556. X    F ^= CBREAK;
  1557. X    i=ioctl(0,TIOCSETP,a);
  1558. X    if(i<0)exit(6);
  1559. X}
  1560. X#else
  1561. Xnocbreak(){
  1562. X    while(getchar()!='\n') /*null*/ ;
  1563. X}
  1564. X#endif
  1565. END_OF_FILE
  1566. if test 308 -ne `wc -c <'nocbreak.c'`; then
  1567.     echo shar: \"'nocbreak.c'\" unpacked with wrong size!
  1568. fi
  1569. # end of 'nocbreak.c'
  1570. fi
  1571. if test -f 'off.txt' -a "${1}" != "-c" ; then 
  1572.   echo shar: Will not clobber existing file \"'off.txt'\"
  1573. else
  1574. echo shar: Extracting \"'off.txt'\" \(273 characters\)
  1575. sed "s/^X//" >'off.txt' <<'END_OF_FILE'
  1576. XYou log off the Unix machines by typing control-d at the
  1577. Xcommand line prompt.  (To type control-d, you HOLD DOWN the
  1578. X"control" key WHILE typing "d"; this is not a two-stroke
  1579. Xsequence -- it's a one-keystroke sequence made by holding
  1580. Xdown the first while typing the second).
  1581. END_OF_FILE
  1582. if test 273 -ne `wc -c <'off.txt'`; then
  1583.     echo shar: \"'off.txt'\" unpacked with wrong size!
  1584. fi
  1585. # end of 'off.txt'
  1586. fi
  1587. if test -f 'pascal.txt' -a "${1}" != "-c" ; then 
  1588.   echo shar: Will not clobber existing file \"'pascal.txt'\"
  1589. else
  1590. echo shar: Extracting \"'pascal.txt'\" \(121 characters\)
  1591. sed "s/^X//" >'pascal.txt' <<'END_OF_FILE'
  1592. XThe pascal compiler is invoked by
  1593. X$ pascal filename.p
  1594. XThe executable is named "a.out" in your directory.
  1595. X
  1596. XSee also "ap".
  1597. END_OF_FILE
  1598. if test 121 -ne `wc -c <'pascal.txt'`; then
  1599.     echo shar: \"'pascal.txt'\" unpacked with wrong size!
  1600. fi
  1601. # end of 'pascal.txt'
  1602. fi
  1603. if test -f 'passwd.txt' -a "${1}" != "-c" ; then 
  1604.   echo shar: Will not clobber existing file \"'passwd.txt'\"
  1605. else
  1606. echo shar: Extracting \"'passwd.txt'\" \(93 characters\)
  1607. sed "s/^X//" >'passwd.txt' <<'END_OF_FILE'
  1608. XThe command to change your password is
  1609. X$ passwd
  1610. XNote the spelling: "passwd", not "password".
  1611. END_OF_FILE
  1612. if test 93 -ne `wc -c <'passwd.txt'`; then
  1613.     echo shar: \"'passwd.txt'\" unpacked with wrong size!
  1614. fi
  1615. # end of 'passwd.txt'
  1616. fi
  1617. if test -f 'phone.txt' -a "${1}" != "-c" ; then 
  1618.   echo shar: Will not clobber existing file \"'phone.txt'\"
  1619. else
  1620. echo shar: Extracting \"'phone.txt'\" \(273 characters\)
  1621. sed "s/^X//" >'phone.txt' <<'END_OF_FILE'
  1622. XYou can talk or phone another logged in user just by typing
  1623. X% phone joeblow
  1624. XYour target talkee should respond with
  1625. X% phone whoeveryouare
  1626. XNote that your target talkee may be refusing phone calls,
  1627. Xif he/she has executed the 'mesg n' command.
  1628. X
  1629. XPhone and talk are synonymous.
  1630. X
  1631. END_OF_FILE
  1632. if test 273 -ne `wc -c <'phone.txt'`; then
  1633.     echo shar: \"'phone.txt'\" unpacked with wrong size!
  1634. fi
  1635. # end of 'phone.txt'
  1636. fi
  1637. if test -f 'pwd.txt' -a "${1}" != "-c" ; then 
  1638.   echo shar: Will not clobber existing file \"'pwd.txt'\"
  1639. else
  1640. echo shar: Extracting \"'pwd.txt'\" \(132 characters\)
  1641. sed "s/^X//" >'pwd.txt' <<'END_OF_FILE'
  1642. XPwd tells you what directory is your current directory
  1643. X("p"rint "w"orking "d"irectory).  This is how you
  1644. X"find out where you are".
  1645. X
  1646. END_OF_FILE
  1647. if test 132 -ne `wc -c <'pwd.txt'`; then
  1648.     echo shar: \"'pwd.txt'\" unpacked with wrong size!
  1649. fi
  1650. # end of 'pwd.txt'
  1651. fi
  1652. if test -f 'quit.txt' -a "${1}" != "-c" ; then 
  1653.   echo shar: Will not clobber existing file \"'quit.txt'\"
  1654. else
  1655. echo shar: Extracting \"'quit.txt'\" \(0 characters\)
  1656. sed "s/^X//" >'quit.txt' <<'END_OF_FILE'
  1657. END_OF_FILE
  1658. if test 0 -ne `wc -c <'quit.txt'`; then
  1659.     echo shar: \"'quit.txt'\" unpacked with wrong size!
  1660. fi
  1661. # end of 'quit.txt'
  1662. fi
  1663. if test -f 'rename.txt' -a "${1}" != "-c" ; then 
  1664.   echo shar: Will not clobber existing file \"'rename.txt'\"
  1665. else
  1666. echo shar: Extracting \"'rename.txt'\" \(218 characters\)
  1667. sed "s/^X//" >'rename.txt' <<'END_OF_FILE'
  1668. XRename is accomplished by use of the "mv" command.  Don't ask
  1669. Xwhy the command is named "mv" instead of "rename", it just is.
  1670. XUsage:
  1671. X$ mv from to
  1672. Xeffectively renames "from" to be "to".
  1673. XIt does a copy and then a delete.
  1674. END_OF_FILE
  1675. if test 218 -ne `wc -c <'rename.txt'`; then
  1676.     echo shar: \"'rename.txt'\" unpacked with wrong size!
  1677. fi
  1678. # end of 'rename.txt'
  1679. fi
  1680. if test -f 'stat.c' -a "${1}" != "-c" ; then 
  1681.   echo shar: Will not clobber existing file \"'stat.c'\"
  1682. else
  1683. echo shar: Extracting \"'stat.c'\" \(1479 characters\)
  1684. sed "s/^X//" >'stat.c' <<'END_OF_FILE'
  1685. X#include <stdio.h>
  1686. X#include <sys/types.h>
  1687. X#include <sys/stat.h>
  1688. X
  1689. Xmain(argc,argv)
  1690. Xint argc;
  1691. Xchar *argv[];
  1692. X{
  1693. X
  1694. X    int laststat=1,i=1;
  1695. X    char *name;
  1696. X    struct stat buf;
  1697. X    struct stat *pb = &buf;
  1698. X    if(argc<=1)
  1699. X    {
  1700. X        printf("requires an argument\n");
  1701. X        exit(1);
  1702. X    }
  1703. X    for(i=1;i<argc;i++)
  1704. X    {
  1705. X        name = argv[i];
  1706. X        if(lstat(name,pb)== -1)
  1707. X            printf("lstat: %s not found, i=%d\n",name,i);
  1708. X        else
  1709. X        { 
  1710. X            printstat(pb,name);
  1711. X            if((pb->st_mode&S_IFLNK)==S_IFLNK)
  1712. X            {
  1713. X                char realname[257]; int i,jhn;
  1714. X                for(i=0;i<257;i++)realname[i]='\0';
  1715. X                readlink(name,realname,257);
  1716. X                printf( 
  1717. X                "---symbolic link, here's what it points to:---\n");
  1718. X                laststat=0;/*for exiting with 0 status (true)*/
  1719. X                jhn=stat(name,pb);
  1720. X                if(jhn==0)
  1721. X                printstat(pb,realname);
  1722. X                else {printf("\"%s\" not found--this could be a real problem!!\n",realname);exit(1);}
  1723. X            }
  1724. X            else
  1725. X                laststat=1; /*for exiting with false status*/
  1726. X        }
  1727. X    }
  1728. X    exit(laststat);
  1729. X}
  1730. Xprintstat(pb,name)
  1731. Xstruct stat *pb;
  1732. Xchar *name;
  1733. X{
  1734. X    char *ptime, *ctime();
  1735. X    printf("%s: ---------\n",name);
  1736. X    printf("file-mode=%o(oct)   inode=%d   st_dev=%x(hex)   #links=%d\n",
  1737. X    pb->st_mode,
  1738. X    pb->st_ino, 
  1739. X    pb->st_dev,
  1740. X    pb->st_nlink);
  1741. X    printf("owner=%d   group=%d   filesize=%d bytes\n",
  1742. X    pb->st_uid,pb->st_gid,pb->st_size);
  1743. X    ptime=ctime(&(pb->st_atime));
  1744. X    printf("data last accessed       %s",ptime);
  1745. X    ptime=ctime(&(pb->st_mtime));
  1746. X    printf("data last modified       %s",ptime);
  1747. X    ptime=ctime(&(pb->st_ctime));
  1748. X    printf("file status last changed %s",ptime);
  1749. X}
  1750. END_OF_FILE
  1751. if test 1479 -ne `wc -c <'stat.c'`; then
  1752.     echo shar: \"'stat.c'\" unpacked with wrong size!
  1753. fi
  1754. # end of 'stat.c'
  1755. fi
  1756. if test -f 'talk.txt' -a "${1}" != "-c" ; then 
  1757.   echo shar: Will not clobber existing file \"'talk.txt'\"
  1758. else
  1759. echo shar: Extracting \"'talk.txt'\" \(273 characters\)
  1760. sed "s/^X//" >'talk.txt' <<'END_OF_FILE'
  1761. XYou can talk or phone another logged in user just by typing
  1762. X% phone joeblow
  1763. XYour target talkee should respond with
  1764. X% phone whoeveryouare
  1765. XNote that your target talkee may be refusing phone calls,
  1766. Xif he/she has executed the 'mesg n' command.
  1767. X
  1768. XPhone and talk are synonymous.
  1769. X
  1770. END_OF_FILE
  1771. if test 273 -ne `wc -c <'talk.txt'`; then
  1772.     echo shar: \"'talk.txt'\" unpacked with wrong size!
  1773. fi
  1774. # end of 'talk.txt'
  1775. fi
  1776. if test -f 'terminal.txt' -a "${1}" != "-c" ; then 
  1777.   echo shar: Will not clobber existing file \"'terminal.txt'\"
  1778. else
  1779. echo shar: Extracting \"'terminal.txt'\" \(533 characters\)
  1780. sed "s/^X//" >'terminal.txt' <<'END_OF_FILE'
  1781. XYour terminal can be any one known to this system (last count about
  1782. X391 different kinds), but you must make it known to the system
  1783. Xwhat kind you are using.  The command to do that (if your login
  1784. Xsequence doesn't offer you your terminal type) is:
  1785. X% setenv TERM <whatever>
  1786. X
  1787. XYou can see all 391 different names we support by typing:
  1788. X% terminals
  1789. X
  1790. XIn general, the adds viewpoints (black face and keyboard housing) are
  1791. Xtype "av", and the vt200 series (white with ugly green stencilling on
  1792. Xthe sides) can be safely be thought to be vt100s.
  1793. END_OF_FILE
  1794. if test 533 -ne `wc -c <'terminal.txt'`; then
  1795.     echo shar: \"'terminal.txt'\" unpacked with wrong size!
  1796. fi
  1797. # end of 'terminal.txt'
  1798. fi
  1799. if test -f 'test.txt' -a "${1}" != "-c" ; then 
  1800.   echo shar: Will not clobber existing file \"'test.txt'\"
  1801. else
  1802. echo shar: Extracting \"'test.txt'\" \(298 characters\)
  1803. sed "s/^X//" >'test.txt' <<'END_OF_FILE'
  1804. XTest is useful for testing the existence of files (from within
  1805. Xshell scripts).  Be careful not to name your "test" programs
  1806. X"test", because you won't be running your test, you'll be
  1807. Xrunning the system's program called "test".
  1808. XFor example:
  1809. X% cc -o test test.c
  1810. X% test
  1811. Xdoesn't work the way you think.
  1812. END_OF_FILE
  1813. if test 298 -ne `wc -c <'test.txt'`; then
  1814.     echo shar: \"'test.txt'\" unpacked with wrong size!
  1815. fi
  1816. # end of 'test.txt'
  1817. fi
  1818. if test -f 'ulgrp' -a "${1}" != "-c" ; then 
  1819.   echo shar: Will not clobber existing file \"'ulgrp'\"
  1820. else
  1821. echo shar: Extracting \"'ulgrp'\" \(263 characters\)
  1822. sed "s/^X//" >'ulgrp' <<'END_OF_FILE'
  1823. X#!/bin/sh
  1824. Xcase $1 in
  1825. X    "")
  1826. X    awk -F:  '{printf "%10s %4d %4d %-15s %-19s %-18s\n",$1,$3,$4,$6,$5,$2}' /etc/passwd|
  1827. Xsort +2n 
  1828. X;;
  1829. X    *) awk -F: '$4=='$1' {print}' /etc/passwd |
  1830. X  awk -F: '{printf "%10s %4d %4d %-15s %-19s\n",$1,$3,$4,$6,$5}' |
  1831. Xsort +0 -1 -b  
  1832. X
  1833. X;;
  1834. Xesac
  1835. END_OF_FILE
  1836. if test 263 -ne `wc -c <'ulgrp'`; then
  1837.     echo shar: \"'ulgrp'\" unpacked with wrong size!
  1838. fi
  1839. chmod +x 'ulgrp'
  1840. # end of 'ulgrp'
  1841. fi
  1842. if test -f 'vi.txt' -a "${1}" != "-c" ; then 
  1843.   echo shar: Will not clobber existing file \"'vi.txt'\"
  1844. else
  1845. echo shar: Extracting \"'vi.txt'\" \(2347 characters\)
  1846. sed "s/^X//" >'vi.txt' <<'END_OF_FILE'
  1847. XVi is the "visual" editor for the UNIX machines.  It differs
  1848. Xfrom the VAX/VMS editor in that vi is a "moded" editor: you
  1849. Xare either in COMMAND MODE or you are in INPUT MODE.  In 
  1850. XCOMMAND MODE, each keystroke is assumed to be a command; in
  1851. XINPUT MODE, each keystroke is put into the file unless it is
  1852. Xbackspace (the funny "X" key inside the diamond on vt220s) or
  1853. XESCAPE.  ESCAPE terminates the INPUT MODE, and puts you back to
  1854. XCOMMAND MODE.  If you don't know what mode you're in, hit
  1855. XESCAPE until your terminal beeps.  Then you are in COMMAND MODE.
  1856. X
  1857. XIn COMMAND MODE, the most useful commands are:
  1858. Xi<string>ESC -- goes into INPUT MODE until you hit ESCAPE
  1859. Xa<string>ESC -- like "i", but APPENDS (after instead of before)
  1860. Xx -- deletes (x's out) one character
  1861. Xdw -- delete word (up to next blank)
  1862. Xdd -- delete whole line
  1863. Xo -- open a line up after the current line and go to INPUT MODE
  1864. Xr -- replace the char under the cursor with one next character
  1865. XA -- append to end of line (good for putting in forgotten semicolons)
  1866. X0 -- NOTE: zero, not "oh" -- go to beginning of this line
  1867. X$ -- go to end of this line
  1868. XG -- go to last line in file
  1869. X:1 -- go to first line in file
  1870. X^d -- that's control-d  -- page down
  1871. X^b -- (control-b) page backward
  1872. X/<string> -- (do not type the < or >) search for <string>
  1873. Xn -- search for next occurrence of previous string
  1874. XZZ -- save edited version of file and exit
  1875. X:wq -- same as ZZ
  1876. Xh -- cursor left
  1877. Xj -- cursor down
  1878. Xk -- cursor up
  1879. Xl -- cursor right
  1880. X
  1881. X     NOTE: the arrow keys may work (sometimes, on some, but not
  1882. X     all, terminals), but once you get in the habit of using hjkl,
  1883. X     you'll like it! -- you don't have to pick up your right hand
  1884. X     and move it over to the arrows!!  Get used to it!!
  1885. X
  1886. XIn INPUT MODE, a few keys have special meaning:
  1887. XBACKSPACE -- (the funny "X" key on vt220s) -- erase the last character
  1888. X     you just typed.  This is not the same as "x" in COMMAND MODE.
  1889. XESCAPE -- terminate INPUT MODE, putting you back to COMMAND MODE
  1890. X^d -- undo an auto-indent that just happened
  1891. XNOTE: THE ARROW KEYS ARE INOPERATIVE IN INPUT MODE AND MAY YIELD
  1892. XSTRANGE RESULTS.  STAY AWAY FROM THE ARROW KEYS!    
  1893. X
  1894. XYou can get several flavors of tutorials on the use of "vi"; there
  1895. Xare a "short" and a "long" help-file which can be dumped to your
  1896. Xscreen by typing
  1897. X% helpvi
  1898. Xand there is, of course, the "learn" tutorial package, as in
  1899. X% learn
  1900. X
  1901. X
  1902. END_OF_FILE
  1903. if test 2347 -ne `wc -c <'vi.txt'`; then
  1904.     echo shar: \"'vi.txt'\" unpacked with wrong size!
  1905. fi
  1906. # end of 'vi.txt'
  1907. fi
  1908. echo shar: End of archive 1 \(of 1\).
  1909. cp /dev/null ark1isdone
  1910. MISSING=""
  1911. for I in 1 ; do
  1912.     if test ! -f ark${I}isdone ; then
  1913.     MISSING="${MISSING} ${I}"
  1914.     fi
  1915. done
  1916. if test "${MISSING}" = "" ; then
  1917.     echo You have the archive.
  1918.     rm -f ark[1-9]isdone
  1919. else
  1920.     echo You still need to unpack the following archives:
  1921.     echo "        " ${MISSING}
  1922. fi
  1923. ##  End of shell archive.
  1924. exit 0
  1925. -- 
  1926. Jim Nelson,UNC-Wilmington,Mathematical Sciences Dept, 919-395-3300
  1927. nelson@uncw.uucp or nelson@ecsvax.uncecs.edu or nelson@ecsvax.bitnet
  1928. or {...,mcnc}!ecsvax!nelson or {...,mcnc}!ecsvax!uncw!nelson
  1929.  
  1930.